using System;
using System.Data;
using System.Web.Caching;
using System.Reflection;
using DotNetNuke;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Services.Localization;


namespace gdlmo.DNN.Modules.Dept.Data
{
	public abstract class DataProvider
	{
		#region Shared/Static Methods
        // singleton reference to the instantiated object 
		private static DataProvider objProvider = null;

		// constructor
		static DataProvider()
		{
			CreateProvider();
		}

		// dynamically create provider
		private static void CreateProvider()
		{
			objProvider = ((DataProvider)DotNetNuke.Framework.Reflection.CreateObject("data", "gdlmo.DNN.Modules.Dept.Data", "gdlmo.DNN.Modules.Dept"));
		}

		// return the provider
		public static DataProvider Instance()
		{
			return objProvider;
		}

		#endregion
		#region "Dept Abstract Methods"
		public abstract IDataReader GetDept(int DeptId);
        public abstract IDataReader GetDepts(int ModuleId, int ParentId);
        //public abstract IDataReader ListDept();
        //public abstract IDataReader GetDeptByModules(int ModuleID );
		public abstract int AddDept(int ModuleId, string DeptName, string Description, int ParentId, int ViewOrder, bool IsActive , string CreatedByUser);
		public abstract void UpdateDept(int DeptId, int ModuleId , string DeptName , string Description , int ParentId , int ViewOrder , bool IsActive , string CreatedByUser);
		public abstract void DeleteDept(int DeptId);
		#endregion
    }
}

